fix(cli): only route auxiliary tasks to kilo-auto/small with kilo credentials - #13192
Conversation
…entials getSmallModel unconditionally fell back to the cloud kilo-auto/small model because the kilo provider is always autoloaded with an anonymous key. For users without kilo access (offline or local-only setups), session title, commit message, and branch name generation were routed to an unreachable model and failed silently. Gate the fallback on actual kilo credentials (KILO_API_KEY env, auth entry, or config apiKey) so those auxiliary tasks use the session's own model.
…model-fallback Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1dc515ff0d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (1 files)
Previous Review Summaries (2 snapshots, latest commit 466ae2a)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 466ae2a)Status: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Previous review (commit 1dc515f)Status: 1 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (4 files)
Reviewed by grok-4.6 · Input: 87.9K · Output: 7.3K · Cached: 470.5K Review guidance: REVIEW.md from base branch |
|
Addressed both review findings in 466ae2a:
Verified locally: both relocated tests pass, |
|
Re-triggering CI after a flaky |
…model-fallback Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
Once getSmallModel no longer falls back to the kilo cloud model without credentials, auxiliary session-title generation resolves to the session's own model. In the mock-server compaction safety tests the session model is the test model, so the forked title call hits the mock server and shifts the exact llm.calls assertions by one. Create those sessions with explicit titles so ensureTitle early-returns and the call counts keep asserting the compaction behavior only. Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
|
Merge-readiness check complete:
Ready for human review. |
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
…x-task-small-model-fallback Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
|
Merge-readiness sweep complete: branch synced with current main (ffc0655, 0 behind), no merge conflicts, CI green on the latest head. Ready for human review. |
…model-fallback Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
|
To use Kilo from GitHub you first need to link your GitHub account to Kilo. Link your Kilo account to continue. After linking, mention me again in this issue or pull request. |
|
@kilocode-bot can you please check again? The opencode change without surrounding comments does not look right but your last check was also weeks ago, thanks. |
|
To use Kilo from GitHub you first need to link your GitHub account to Kilo. Link your Kilo account to continue. After linking, mention me again in this issue or pull request. |
|
@kilocode-bot can you please check again? The opencode change without surrounding comments does not look right but your last check was also weeks ago, thanks. |
|
To use Kilo from GitHub you first need to link your GitHub account to Kilo. Link your Kilo account to continue. After linking, mention me again in this issue or pull request. |
|
@kilocode-bot can you please check again? The opencode change without surrounding comments does not look right but your last check was also weeks ago, thanks. |
|
To use Kilo from GitHub you first need to link your GitHub account to Kilo. Link your Kilo account to continue. After linking, mention me again in this issue or pull request. |
|
@kilocode-bot can you please check again? The opencode change without surrounding comments does not look right but your last check was also weeks ago, thanks. |
|
Checked again at head On "no surrounding comments": the shared-file hunk in Other non-blocking findings:
All production callers of Recommendation: Merge-able as is, but I'd suggest adding a one-line comment explaining the |
WebReflection
left a comment
There was a problem hiding this comment.
Summary here, it's a matter of a comment that can be discoverable later on if needed, I think this looks good to me.
reference: #13192 (comment)
Fixes #13151
TL;DR
getSmallModelalways fell back to the cloudkilo-auto/smallmodel because the kilo provider is autoloaded with an anonymous key. Session title generation, commit messages, and branch names were silently routed to an unreachable cloud model for users without kilo access — offline/local-only setups saw titles never update (7.4.22 regression, see #13151; likely contributor to #12962 commit-message timeouts).Change
packages/opencode/src/provider/provider.ts: gate thekilo-auto/smallfallback on actual kilo credentialspackages/opencode/src/kilocode/provider/provider.ts: newhasKiloCredentials()helper mirroring the kilo loader'shasKeycheck (KILO_API_KEYenv, stored auth entry, or configprovider.kilo.options.apiKey)packages/opencode/test/provider/provider.test.ts: split the old "always falls back" test into a no-credentials case (expectsundefined→ callers use the session's own model) and a configured case (still returnskilo-auto/small)Verification
bun run typecheck(packages/opencode): passbun test test/provider/provider.test.ts --test-name-pattern "getSmallModel": 10 pass / 0 failprovider.test.ts: 97 pass / 3 fail — the 3 failures (defaultModel respects config,defaultModel typed error,opencode loader paid models) are pre-existing on the base commit in this sandbox (network/model-cache related), unchanged by this PRNote: pre-push hook typecheck fails only on
@kilocode/kilo-jetbrains(no Java in sandbox); opencode package typecheck is green.